﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;
namespace Project.module
{
    public partial class frmDatban : Form
    {
        public frmDatban()
        {
            InitializeComponent();
        }

        private void bntXacnhan_Click(object sender, EventArgs e)
        {
            
            if (Kiemtra())
            {
                DatBanDTO db = new DatBanDTO();
                db.TenKH = txtTenkh.Text;
                db.SDT = txtSdt.Text;
                db.Soluong = int.Parse(txtSokhach.Text);
                db.Ngay = (DateTime)dtpTime.Value;
                db.Gio = txtGio.Text;
                db.Tinhtrang = 1;
                if(DatBanBUS.Datban(db))
                {
                    MessageBox.Show("Đặt bàn thành công !");
                    this.Close();

                }
            }
        }
        private bool Kiemtra()
        {
            return true;
        }

        private void bntHuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
